<?php require_once('init.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Silesia Racing Time Battle</title>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
 <meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="table_sorter/style_blue.css" />
<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>  
<script type="text/javascript" src="js/jquery.betterTooltip.js"></script>  
<script type="text/javascript" src="js/jquery-latest.js"></script> 
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<script>
$(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 

    
</script>
</head>
<body>
    <div id="wrapper">
        <div id="headerwrap">
        <div id="header">
           <p align="right"> Silesia Racing Time Battle EVOLution</p>
        </div>
        </div>
		<div id="topwrap">
        <div id="top_home">		
           <h2>Time Battle - View Drivers</h2>
        </div>
        </div>
        <div id="leftcolumnwrap">
        <div id="leftcolumn">
            <?php include_once ('menu_left.php');?>
        </div>
        </div>
        <div id="contentwrap">
        <div id="content">
		<div>   
		<p></p>
		
		<table id="myTable" class="tablesorter"> 
<thead> 
<tr> 
    <th>Driver</th>
	<th>Model</th>
	<th>Engine</th>
	<th>Fuel</th>
	<th colspan="2">Horsepower</th>
	<th>Class</th>
	<th colspan="2">Torque</th>
	<th colspan="2">Weight</th>
	<th>KM/Kg</th>
</tr> 
</thead> 
<tbody> 
<?php
			$result = mysql_query("SELECT driver.id, driver.description, driver.model, driver.engine, driver.fuel, driver.horsepower, driver.torque, driver.weight, class.class AS class
FROM driver, class
WHERE 
driver.class_id = class.id"); 
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
			while($row = mysql_fetch_array($result))
			
			{
			echo "<TR>";
			echo "<TD>" . $row['description']  . "	</TD>";	   
			echo "<TD>" . $row['model']  . " </TD>";  
			echo "<TD>" . $row['engine']  . "</TD>";  
			echo "<TD>" . $row['fuel']  . "</TD>";  
			echo "<TD align=right>" . $row['horsepower']  . " </TD>";  
			echo "<TD>Hp</TD>";  
			echo "<TD>" . $row['class']  . "</TD>";  
			echo "<TD align=right> " . $row['torque']  . " </TD>";  
			echo "<TD>Nm</TD>";  
			echo "<TD align=right> " . $row['weight']  . "</TD>"; 
			echo "<TD>Kg</TD>"; 
			$w = $row['weight'];
			$h = $row['horsepower'];
			$wh = round(($h/$w)*100, 2);
			echo "<TD> $wh </TD>";  
			}
			  echo "</TR>"	;
		?> 
</tbody> 
</table> 
		
		
		</div>
        </div>
        </div>
        <div id="rightcolumnwrap">
        <div id="rightcolumn">
			<?php include_once ('right_column.php');?>
			<p></p>
        </div>
        </div>
        <div id="footerwrap">
        <div id="footer">
            <p>Silesia Racing Time Battle</p>
        </div>
        </div>
    </div>
</body>
</html>
